package com.yanqu.road.entity.wingroom.chakra.data;

import com.yanqu.road.entity.DataObject;

public class UserWingRoomChakraBeVisitNum extends DataObject {

    //玩家ID
    private long userId;

    //被拜访次数
    private int beVisitNum;

    //上一次恢复时间
    private long lastRecoverTime;

    public UserWingRoomChakraBeVisitNum(long userId, int beVisitNum, long lastRecoverTime) {
        this.userId = userId;
        this.beVisitNum = beVisitNum;
        this.lastRecoverTime = lastRecoverTime;
    }

    public long getUserId() {
        return userId;
    }

    public int getBeVisitNum() {
        return beVisitNum;
    }
    public long getLastRecoverTime() {
        return lastRecoverTime;
    }

    public void setBeVisitNum(int beVisitNum) {
        if(this.beVisitNum != beVisitNum) {
            this.beVisitNum = beVisitNum;
            setUpdateOption();
        }
    }

    public void addBeVisitNum(int num) {
        this.beVisitNum += num;
        setUpdateOption();
    }

    public void setLastRecoverTime(long lastRecoverTime) {
        if(this.lastRecoverTime != lastRecoverTime) {
            this.lastRecoverTime = lastRecoverTime;
            setUpdateOption();
        }
    }
}
